﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Photo.Master" AutoEventWireup="true"
    CodeBehind="ListAlbum.aspx.cs" Inherits="Photo.ListAlbum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 class="h2-pro">
        Danh sách Album</h2>
    <div class="scroll">
        <asp:GridView ID="gvListAlbum" runat="server" AutoGenerateColumns="False" CssClass="tstyle2"
            Width="100%" DataKeyNames="AlbumID" OnPageIndexChanging="gvListAlbum_PageIndexChanging"
            OnRowDeleting="gvListAlbum_RowDeleting" OnSelectedIndexChanged="gvListAlbum_SelectedIndexChanged"
            AllowPaging="True" EditRowStyle-HorizontalAlign="Center" PageSize="20" PagerStyle-CssClass="pgr">
            <Columns>
                <asp:TemplateField HeaderText="Ảnh Đại Diện">
                    <ItemTemplate>
                        <a class="fackybox" href='/Media/<%#Eval("AnhDaiDien") %>'>
                            <img src='/Media/<%#Eval("AnhDaiDien") %>' height="60px" width="60px" alt='<%#Eval("Title") %>'
                                title='<%#Eval("Title") %>' />
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="AlbumID" HeaderText="AlbumID" Visible="false">
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Title" HeaderText="Tiêu Đề" ItemStyle-Width="35%" />
                <asp:BoundField DataField="Mota" HeaderText="Mô Tả" ItemStyle-Width="35%" />
                <asp:TemplateField HeaderText="Thao tác">
                    <ItemTemplate>
                        <asp:ImageButton ID="btEdit" runat="server" CommandArgument='<%#Eval("AlbumID") %>'
                            CommandName="Select" ImageUrl="~/image/edit_16x16.gif" />
                        <asp:ImageButton ID="btDelete" runat="server" CommandArgument='<%#Eval("AlbumID") %>'
                            CommandName="Delete" ImageUrl="~/image/delete_16x16.gif" OnClientClick="return confirm('Có muốn xóa bản ghi này? Nhấn OK để xóa!')" />
                        <asp:HyperLink ForeColor="#003366" Style="text-decoration: underline" runat="server"
                            ID="ChiTiet" NavigateUrl='<%#Eval("AlbumID", "IMG.aspx?AlbumID={0}") %>' Text="Upload">
                        </asp:HyperLink>
                        <asp:HyperLink ForeColor="#003366" Style="text-decoration: underline" runat="server"
                            ID="HyperLink1" NavigateUrl='<%#Eval("AlbumID", "ListIMG.aspx?AlbumID={0}") %>' Text="ListIMG">
                        </asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle"></EditRowStyle>
        </asp:GridView>
        <asp:HyperLink runat="server" ID="hplAdd" NavigateUrl="../Album.aspx" CssClass="button-gg-green"
            Text="Thêm mới"></asp:HyperLink>
    </div>
</asp:Content>
